<?php

namespace App\Models;

//继承可以使用auth登录的模型类
use Illuminate\Foundation\Auth\User as AuthUser;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Traits\Btn;
class User extends AuthUser
{
    use SoftDeletes,Btn;//调用定义的trait类 和继承一样
    //软删除
    protected $dates = ['deleted_at'];
    //设置添加的字段
    //拒绝不能添加的字段
    protected $guarded=[];
    //隐藏字段
    protected $hidden = ['password'];

    //角色 属于
    public function role()
    {
        return $this->belongsTo(Role::class,'role_id');
    }
}
